/*
 * @Description: 社交服务
 * @Author: Kerwin
 * @Date: 2023-06-29 15:54:59
 * @LastEditTime: 2025-04-15 16:30:41
 * @LastEditors:  Please set LastEditors
 */
import http from '../http'

/**
 * 动态
 */
function dynamicAdd(data: any) {
  return http.post('/social/api/v1/dynamic/add', data)
}
function dynamicList(data: any) {
  return http.get('/social/api/v1/dynamic/list', data)
}
function dynamicDelete(data: any) {
  return http.get('/social/api/v1/dynamic/delete', data)
}
function dynamicInfo(data: any) {
  return http.get('/social/api/v1/dynamic/info', data)
}
function dynamicUpdate(data: any) {
  return http.post('/social/api/v1/dynamic/update', data)
}
/**
 * 朋友圈
 */
function circleAdd(data: any) {
  return http.post('/social/api/v1/friend/circle/add', data)
}
/**
 * 聊天群
 * @param data
 * @param data.type type=1就是查询城市聊天群
 * @returns
 */
function circleList(data: any) {
  return http.get('/social/api/v1/friend/circle/list', data)
}
function circleDelete(data: any) {
  return http.get('/social/api/v1/friend/circle/delete', data)
}
function circleInfo(data: any) {
  return http.get('/social/api/v1/friend/circle/info', data)
}
function circleUpdate(data: any) {
  return http.post('/social/api/v1/friend/circle/update', data)
}
/**
 * 朋友圈动态
 */
function circleDynamicAdd(data: any) {
  return http.post('/social/api/v1/friend/circle/dynamic/add', data)
}
function circleDynamicList(data: any) {
  return http.get('/social/api/v1/friend/circle/dynamic/list', data)
}
function circleDynamicDelete(data: any) {
  return http.get('/social/api/v1/friend/circle/dynamic/delete', data)
}
function circleDynamicInfo(data: any) {
  return http.get('/social/api/v1/friend/circle/dynamic/info', data)
}
function circleDynamicUpdate(data: any) {
  return http.post('/social/api/v1/friend/circle/dynamic/update', data)
}
/**
 * 朋友圈用户
 */
function circleUserAdd(data: any) {
  return http.post('/social/api/v1/friend/circle/user/add', data)
}
function circleUserList(data: any) {
  return http.get('/social/api/v1/friend/circle/user/list', data)
}
function circleUserDelete(data: any) {
  return http.get('/social/api/v1/friend/circle/user/delete', data)
}
function circleUserUpdate(data: any) {
  return http.post('/social/api/v1/friend/circle/user/update', data)
}
//加好友申请
function circleUserApplyAdd(data: any) {
  return http.post('/social/api/v1/friend/circle/user/apply/add', data)
}
//好友申请审核
function circleUserApplyInfo(data: any) {
  return http.post('/social/api/v1/friend/circle/user/apply/info', data)
}
//好友申请列表
function circleUserApplyList(data?: any) {
  return http.post('/social/api/v1/friend/circle/user/apply/list', data)
}

/**
 * 用户详情信息
 */
function userDetailAdd(data: any) {
  return http.post('/social/api/v1/user/detail/add', data)
}
function userDetailInfo(data: any) {
  return http.get('/social/api/v1/user/detail/info', data)
}
function userDetailList(data: any) {
  return http.get('/social/api/v1/user/detail/list', data)
}
function userDetailDelete(data: any) {
  return http.get('/social/api/v1/user/detail/delete', data)
}
function userDetailUpdate(data: any) {
  return http.post('/social/api/v1/user/detail/update', data)
}
function infoAndRongYunToken(data: any) {
  return http.get('/social/api/v1/user/detail/infoAndRongYunToken', data)
}
/**
 * 名人标签列表接口
 */
function userDetailTagAdd(data: any) {
  return http.post('/social/api/v1/user/detail/tag/add', data)
}
function userDetailTagList(data: any) {
  return http.get('/social/api/v1/user/detail/tag/list', data)
}
function userDetailTagDelete(data: any) {
  return http.get('/social/api/v1/user/detail/tag/delete', data)
}
/**
 * 用户关注
 */
function userFocusAdd(data: any) {
  return http.post('/social/api/v1/user/focus/add', data)
}
function userFocusList(data: any) {
  return http.get('/social/api/v1/user/focus/list', data)
}
function userFocusDelete(data: any) {
  return http.get('/social/api/v1/user/focus/delete', data)
}
/**
 * 动态收藏（点赞）
 */
function dynamicFavoriteAdd(data: any) {
  return http.post('/social/api/v1/dynamic/favorite/add', data)
}
function dynamicFavoriteList(data: any) {
  return http.get('/social/api/v1/dynamic/favorite/list', data)
}
function dynamicFavoriteDelete(data: any) {
  return http.get('/social/api/v1/dynamic/favorite/delete', data)
}
/**
 * 阅读查看
 */
function dynamicDetailRead(data: any) {
  return http.get('/social/api/v1/user/detail/read', data)
}
/**
 * 根据经纬度查询聊天群信息
 */
function getChatGroupCityByPosition(data: {
  latitude: number
  longitude: number
  cityId?: number
}) {
  return http.get(
    '/social/api/v1/friend/circle/getChatGroupCityByPosition',
    data
  )
}
/**
 * 进群api
 */
function joinChatGroupCity(data: { friendCircleId: number; userId?: number }) {
  return http.post('/social/api/v1/friend/circle/joinChatGroupCity', data)
}
/**
 * 退群api
 */
function leaveChatGroupCity(data: { friendCircleId: number; userId: number }) {
  return http.get('/social/api/v1/friend/circle/leaveChatGroupCity', data)
}

/**
 * 退群api
 */
function userInfoFormChat(data: { friendCircleId: number;}) {
  return http.get('/social/api/v1/friend/circle/user/info', data)
}
/**
 * 获取群成员列表
 * @param data
 * @param data.friendCircleId 群id
 * @returns
 */
function getChatGroupUsers(data: {
  friendCircleId: number
  [key: string]: any
}) {
  return http.get('/social/api/v1/friend/circle/getChatGroupUsers', data)
}
/**
 * 添加好友
 * @param fromUserId 发送方id
 * @param addUserId 接收方id
 * @returns
 */
function addChatFriend(fromUserId: number, addUserId: number) {
  return http.get('/social/api/v1/friend/circle/user/addChatFriend', {
    fromUserId,
    addUserId
  })
}
/**
 * 获取用户的群列表
 * @param data
 * @param data.userId 用户id
 * @returns
 */
function getUserChatGroup(data: { userId: number; [key: string]: any }) {
  return http.get('/social/api/v1/friend/circle/getUserChatGroup', data)
}
/**
 * 获取好友列表
 * @param data
 * @param data.userId 用户id
 * @returns
 */
function getFriendList(data: { userId: number; [key: string]: any }) {
  return http.get('/social/api/v1/friend/circle/user/getFriendList', data)
}
/**
 * 获取群聊列表
 * @param data
 * @param data.userId 用户id
 * @returns
 */
function getChatGroupList(data: { userId?: number; [key: string]: any }) {
  return http.get('/social/api/v1/friend/circle/getUserChatGroup', data)
}
/**
 * 获取店铺用户列表
 * @param data
 * @param data.shopIds 店铺id数组
 * @param data.purchaseStatus 购买状态 0未购买 1已购买
 * @param data.followingStatus 关注状态 0未关注 1已关注
 * @param data.likedStatus 喜欢状态 0未喜欢 1已喜欢
 * @param data.joinCircleStatus 加入圈子状态 0未加入 1已加入
 * @returns
 */
function getShopUserList(data: { [key: string]: any }) {
  return http.get('/social/api/v1/shop/user/list', data)
}

/**
 * 动态评论新增
 */
function dynamicCommentAdd(data: any) {
  return http.post('/social/api/v1/dynamic/comment/add', data)
}
/**
 * 动态评论列表
 */
function dynamicCommentList(data: { [key: string]: any }) {
  return http.get('/social/api/v1/dynamic/comment/list', data)
}
/**
 * 动态评论列表（带子评论）
 */
function dynamicCommentListWithChild(data: { [key: string]: any }) {
  return http.get('/social/api/v1/dynamic/comment/getListWithChild', data)
}
/**
 * 获取动态转发收益
 * @param data
 * @param data.id 动态id
 * @param data.type 转发类型
 * @returns
 */
function forwardFinish(data: { id: any; type: number }) {
  return http.get('/social/api/v1/dynamic/forwardFinish', data)
}

/**
 * 圈子管理员申请
 * @param data
 * @param data.userId 用户id
 * @param data.provinceId 省id
 * @param data.cityId 市id
 * @param data.districtId 区id
 */
function circleAdminApply(data: any) {
  return http.post('/social/api/v1/friend/circle/admin/apply/add', data)
}


/**
 * 用户朋友关系
 */
function friendList(data: any) {
  return http.get('/social/api/v1/user/friend/list', data)
}








export default {
  dynamicAdd,
  dynamicList,
  dynamicDelete,
  dynamicInfo,
  dynamicUpdate,
  circleDynamicAdd,
  circleDynamicList,
  circleDynamicDelete,
  circleDynamicInfo,
  circleDynamicUpdate,
  circleAdd,
  circleList,
  circleDelete,
  circleInfo,
  circleUpdate,
  circleUserAdd,
  circleUserList,
  circleUserDelete,
  circleUserUpdate,
  circleUserApplyAdd,
  circleUserApplyInfo,
  circleUserApplyList,
  userDetailAdd,
  userDetailInfo,
  userDetailList,
  userDetailDelete,
  userDetailUpdate,
  infoAndRongYunToken,
  userDetailTagAdd,
  userDetailTagList,
  userDetailTagDelete,
  userFocusAdd,
  userFocusList,
  userFocusDelete,
  dynamicFavoriteAdd,
  dynamicFavoriteList,
  dynamicFavoriteDelete,
  dynamicDetailRead,
  getChatGroupCityByPosition,
  joinChatGroupCity,
  leaveChatGroupCity,
  getChatGroupUsers,
  addChatFriend,
  getUserChatGroup,
  getFriendList,
  getChatGroupList,
  getShopUserList,
  dynamicCommentAdd,
  dynamicCommentList,
  dynamicCommentListWithChild,
  forwardFinish,
  circleAdminApply,
  userInfoFormChat,
  friendList
}
